const Liquid = require('liquid')
const path = require("path")
const fs = require("fs")
const Koa = require('koa')
const router = require('koa-router')()

const app = new Koa()
const engine = new Liquid.Engine()
const indexTPL = fs.readFileSync(path.join(__dirname, "./src/index.html"), "utf-8")

router.get('/', async (ctx, next) => {
    ctx.body = await engine.parseAndRender(indexTPL, { arr: ['我是', '练习时长', '两年半的', '偶像', '练习生', '小蔡蔡'] })
})

app.use(router.routes()).use(router.allowedMethods()).listen(3000)